import numpy as np
'''
找出缺失的最小正整数
'''
arr = np.array([2,3,4])
def get_miss(arr):
    sort_arr = np.argsort(arr)
    max = np.argmax(arr)
    max = arr[max]
    min = np.argmin(arr)
    a = np.arange(1,max+1)
    b = np.arange(a.shape[0])[~np.in1d(a,arr)]
    print(a)
    print(b)
    print(a[b[0]])
    return a[b[0]]
    pass
get_miss(arr)
arr = np.array([6,3,5,1,2])
get_miss(arr)

# 生成矩阵
n = 4
def get_res(n):
    new_arr = np.zeros((n,int(n*(n+1)/2)))
    for i in range(1,n+1,1):
        new_arr[i-1][i-1:i+i-1]=i
    print(new_arr)
    pass
get_res(n)
# 求相关矩阵
n, k = 1000, 10
node_xy = np.random.rand(n, 2)
node_fea = np.random.rand(n, k)
print(node_xy)
print(node_fea)
#conv = np.convolve(node_xy,node_fea)
#print(conv)

